﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckOut.aspx.cs" Inherits="EC21_EDiamond.CheckOut" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>.: Thanh Toán :.</title>
    <link rel="icon" href="http://shopping.pnj.com.vn/media/favicon/default/pnj-bullet.png" type="image/x-icon" />
    <link rel="shortcut icon" href="http://shopping.pnj.com.vn/media/favicon/default/pnj-bullet.png" type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="./Content/fontend/css/new/bootstrap.min.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/jquery-ui.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/jquery.selectbox.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/md/quickview/css/jquery.fancybox-1.3.4.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/style.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/mainmenu.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/base/default/css/widgets.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/product_list.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/aw_blog/css/style.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/base/default/superdeals/styles.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/codnitive/sidenav.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/banner/nivo-slider.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/onestepcheckout/onestep.css" media="all" />
    <link rel="stylesheet" type="text/css" href="http://shopping.pnj.com.vn/skin/frontend/pnj/default/css/print.css" media="print" />
    <link media="all" href="./Content/fontend/css/ec21.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/jquery/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/jquery/html5shiv.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/jquery/html5shiv-printshiv.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/prototype/prototype.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/lib/ccard.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/prototype/validation.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/scriptaculous/builder.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/scriptaculous/effects.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/scriptaculous/dragdrop.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/scriptaculous/controls.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/scriptaculous/slider.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/varien/js.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/varien/form.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/varien/menu.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/mage/translate.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/mage/cookies.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/md/quickview/fancy/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/superdeals/timer.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/scriptaculous/scriptaculous.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/superdeals/protoshow.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/onestepcheckout/onestepcheckout.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/js/onestepcheckout/lightbox.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/jquery-ui.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/jquery.selectbox-0.2.min.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/jcarousel.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/jquery.transit.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/menu.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/dbiz.js"></script>
    <script type="text/javascript" src="http://shopping.pnj.com.vn/skin/frontend/pnj/default/js/banner/jquery.nivo.slider.js"></script>
    
</head>
<body>
    <form id="form1" runat="server">
<div class="bg-bottom">
    <div class="bg-top bg-top-home">
        <!--wrapper-->
        <div class="wrapper subPage goldPage">
            <!--header-->
            <div class="header container_16">
                <!--logo-->
                <div class="logo grid_5 suffix_3">
                    <a href="#">EC21</a>
                    <p>Chuyên cung cấp sản phẩm bằng kim cương</p>
                </div><!--end logo-->
                <!--header right-->
                <div class="header-right grid_8">
                    <p class="grid_4 prefix_4 welcome alpha">Chào mừng bạn đến với Ec21!</p>
                    <ul class="links header-tools grid_8 alpha">
                        <li class="first" ><a href="#" title="Tài khoản của tôi" >Tài khoản của tôi</a></li>
                        <li ><a href="#" title="Sản phẩm yêu thích" class="top-link-wishlist">Sản phẩm yêu thích</a></li>
                        <li ><a href="#" title="Gi&#7887; h&agrave;ng" class="top-link-cart">Gi&#7887; h&agrave;ng</a></li>
                        <li ><a href="#" title="Thanh to&aacute;n" class="top-link-checkout">Thanh to&aacute;n</a></li>
                        <li class=" last" ><a href="#" title="&#272;&#259;ng nh&#7853;p" >&#272;&#259;ng nh&#7853;p</a></li>
                    </ul>
                                            <!--                <li class="login"><a href="#">Đăng nhập</a></li>
                                        <li class="cart"><a href="#">Giỏ hàng của bạn</a></li>
                        -->            
                    <div class="clear1"></div>
                    <div class="header-search grid_6 prefix_2 alpha">
                        
                            <input type="text" name="q" value="" class=" grid_4 omega"/>
                            <button class="rounded grid_2 alpha omega">Search</button>
                            <div id="search_autocomplete" class="search-autocomplete"></div>
                            <script type="text/javascript">
                                //<![CDATA[
                                var searchForm = new Varien.searchForm('search_mini_form', 'search', 'Search entire store here...');
                                searchForm.initAutocomplete('#', 'search_autocomplete');
                                //]]>
                            </script>
                        
                    </div>
                </div> <!--end header right-->
                <!--navbar-->
                <div class="navbar grid_16">      
                    <div class="navbar grid_16" style="width: 942px; margin-left: 0px">
                        <ul>
                            <li class="logo_menu"><a href="./Default.aspx">EC21.</a></li>
                            <asp:Repeater ID="rpThuongHieu" runat="server">
                                <ItemTemplate>
                                    <li><a href="./ThuongHieu.aspx?id=<%#Eval("MaTH")%>"><span><%#Eval("TenTH")%></span></a></li>
                                </ItemTemplate>
                            </asp:Repeater>
                            <li><a href="#"><span style="color: #FF0000">SALE OFF</span></a></li>        
                        </ul>
                    </div>
                </div><!--end navbar-->
            </div><!--end header-->
            <div class="clear"></div>   
            <div id="maincontain" class="container col1-layout">
                <div class="main">
                                                <div class="col-main">
                                                        

            <div id="scroll" class="rounded">
            <div class="onepage-page-title">
                <h1>Thông tin đơn hàng</h1>
                            </div>

            <!---start of onestepcheckout-form -->
            <form id="co-form" action="" method="post" autocomplete="off">
                <ol class="onepage" id="checkoutSteps">
                    <li id="column-1" class="firecheckout-section">
                        <ul>
                            <li id="onepage-billing">
                                <div class="page-title">
    <span class="billing-bg"></span> <h2>Thông tin người đặt hàng</h2>
    <div class="clear"></div>
</div>

    
    <div class="col-1" style="display: none;">
        <!---if guest checkout is activated in admin-->
                    <input type="hidden" name="checkout_method" value="guest" id="login:guest" checked="checked" class="radio" />
            </div>      
        
    <ul class="form-list">
        <!-- start of Default Billing Address -->
                <!-- End of Default Billing Address -->
        
        <!-- start of Billing fields -->
        <li id="billing-new-address-form">
                <input type="hidden" name="billing[address_id]" value="" id="billing:address_id" />
                <input type="hidden" name="qqq" value="" id="register_customer" />
                <div style="display: none;">
                    <input type="text" id="company_name" name="billing[company]" value="" />
                    <input type="text" id="company_taxvat" value="" name="billing[taxvat]">
                    <input type="text" id="company_address" name="companyaddress" value="">
                </div>
                <ul>
                    <li class="fields cust_name">
                        <div class="customer-name">
                            <div class="field name-firstname">
                                <label for="billing:firstname" class="required">Họ tên<em>*</em></label>
                                <asp:TextBox ID="txtHoTen" runat="server" name="billing[firstname]" value="" title="Họ tên" maxlength="255" class="input-text required-entry"  required="required"></asp:TextBox>
        
                            </div>
                        </div>
                    </li>
                    
                    <li class="fields">
                        <label for="billing:email" class="required">Email<em>*</em></label>
                         <asp:TextBox ID="txtEmail" runat="server" value="" title="Email" class="input-text validate-email required-entry"></asp:TextBox>
                        
                    </li>
                                        
                    <li class="fields">
                        <div class="field">
                            <label for="billing:telephone" class="required">Di động<em>*</em></label>
                            <asp:TextBox ID="txtDiDong" runat="server" name="billing[telephone]" value="" title="Điện thoại" class="input-text required-entry validate-number"></asp:TextBox>
                        </div>
                    </li>
                    
                    <li class="fields " >
                        <label for="billing:street1" class="required">Địa chỉ<em>*</em></label>
                        <asp:TextBox ID="txtDiaChi" runat="server" name="billing[street][]" value="" class="input-text required-entry"></asp:TextBox>
                        
                    </li>
                    
                    <li class="fields ">
                        <div class="fields">
                            <label for="billing:region_id" class="required region_id_default">Tỉnh/Thành phố<em>*</em></label>
                            <asp:DropDownList ID="ddlTinh" AutoPostBack="True" runat="server" style="width: 295px;" name="shipping[region_id]" title="Tỉnh/Thành phố" class="validate-select" OnSelectedIndexChanged="ddlTinh_SelectedIndexChanged">

                            </asp:DropDownList>
                            <script type="text/javascript">
                                //<![CDATA[
                                //$('billing:region_id').setAttribute('defaultValue',  "");
                                //]]>
                                //jQuery('.region_id_default').setAttribute('defaultValue',  "Vui lòng chọn");
                            </script>
                            <input type="text" id="billing:region" name="billing[region]" value=""  title="Tỉnh/Thành phố" class="input-text" style="display:none;" />
                        </div>
                    </li>
                                        
                    <li class="fields">
                        <input type="hidden" name="billing[country_id]" id="billing:country_id" value="VN" />
                    </li>

                                        <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
                                    </ul>
        </li>
    </ul>
<!-- End of Billing fields -->

<script type="text/javascript">

    //<![CDATA[
    var billing = new Billing('co-form', 'CheckOut.aspx', 'CheckOut.aspx');
    var billingForm = new VarienForm('co-form');
    $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

    //]]>
    </script>
    <script type="text/javascript">countryRegions = { "config": { "show_all_regions": false, "regions_required": ["VN"] }, "VN": { "485": { "code": "VN-44", "name": "An Giang" }, "486": { "code": "VN-43", "name": "B\u00e0 R\u1ecba-V\u0169ng T\u00e0u" }, "487": { "code": "VN-53", "name": "B\u1eafc C\u1ea1n" }, "488": { "code": "VN-54", "name": "B\u1eafc Giang" }, "489": { "code": "VN-55", "name": "B\u1ea1c Li\u00eau" }, "490": { "code": "VN-56", "name": "B\u1eafc Ninh" }, "491": { "code": "VN-50", "name": "B\u1ebfn Tre" }, "493": { "code": "VN-57", "name": "B\u00ecnh D\u01b0\u01a1ng" }, "494": { "code": "VN-58", "name": "B\u00ecnh Ph\u01b0\u1edbc" }, "495": { "code": "VN-40", "name": "B\u00ecnh Thu\u1eadn" }, "492": { "code": "VN-31", "name": "B\u00ecnh \u0110\u1ecbnh" }, "496": { "code": "VN-59", "name": "C\u00e0 Mau" }, "497": { "code": "VN-48", "name": "C\u1ea7n Th\u01a1" }, "498": { "code": "VN-04", "name": "Cao B\u1eb1ng" }, "505": { "code": "VN-30", "name": "Gia Lai" }, "506": { "code": "VN-03", "name": "H\u00e0 Giang" }, "507": { "code": "VN-63", "name": "H\u00e0 Nam" }, "508": { "code": "VN-64", "name": "H\u00e0 N\u1ed9i" }, "509": { "code": "VN-15", "name": "H\u00e0 T\u00e2y" }, "510": { "code": "VN-23", "name": "H\u00e0 T\u0129nh" }, "511": { "code": "VN-61", "name": "H\u1ea3i D\u01b0\u01a1ng" }, "512": { "code": "VN-62", "name": "H\u1ea3i Ph\u00f2ng" }, "513": { "code": "VN-73", "name": "H\u1eadu Giang" }, "514": { "code": "VN-65", "name": "H\u1ed3 Ch\u00ed Minh" }, "515": { "code": "VN-14", "name": "H\u00f2a B\u00ecnh" }, "542": { "code": "VN-26", "name": "Hu\u1ebf" }, "516": { "code": "VN-66", "name": "H\u01b0ng Y\u00ean" }, "517": { "code": "VN-34", "name": "Kh\u00e1nh H\u00f2a" }, "518": { "code": "VN-47", "name": "Ki\u00ean Giang" }, "519": { "code": "VN-28", "name": "Kon Tum" }, "520": { "code": "VN-01", "name": "Lai Ch\u00e2u" }, "521": { "code": "VN-35", "name": "L\u00e2m \u0110\u1ed3ng" }, "522": { "code": "VN-09", "name": "L\u1ea1ng S\u01a1n" }, "523": { "code": "VN-02", "name": "L\u00e0o Cai" }, "524": { "code": "VN-41", "name": "Long An" }, "525": { "code": "VN-67", "name": "Nam \u0110\u1ecbnh" }, "526": { "code": "VN-22", "name": "Ngh\u1ec7 An" }, "527": { "code": "VN-18", "name": "Ninh B\u00ecnh" }, "528": { "code": "VN-36", "name": "Ninh Thu\u1eadn" }, "529": { "code": "VN-68", "name": "Ph\u00fa Th\u1ecd" }, "530": { "code": "VN-32", "name": "Ph\u00fa Y\u00ean" }, "531": { "code": "VN-24", "name": "Qu\u1ea3ng B\u00ecnh" }, "532": { "code": "VN-27", "name": "Qu\u1ea3ng Nam" }, "533": { "code": "VN-29", "name": "Qu\u1ea3ng Ng\u00e3i" }, "534": { "code": "VN-13", "name": "Qu\u1ea3ng Ninh" }, "535": { "code": "VN-25", "name": "Qu\u1ea3ng Tr\u1ecb" }, "536": { "code": "VN-52", "name": "S\u00f3c Tr\u0103ng" }, "537": { "code": "VN-05", "name": "S\u01a1n La" }, "538": { "code": "VN-37", "name": "T\u00e2y Ninh" }, "539": { "code": "VN-20", "name": "Th\u00e1i B\u00ecnh" }, "540": { "code": "VN-69", "name": "Th\u00e1i Nguy\u00ean" }, "541": { "code": "VN-21", "name": "Thanh H\u00f3a" }, "543": { "code": "VN-46", "name": "Ti\u1ec1n Giang" }, "544": { "code": "VN-51", "name": "Tr\u00e0 Vinh" }, "545": { "code": "VN-07", "name": "Tuy\u00ean Quang" }, "546": { "code": "VN-49", "name": "V\u0129nh Long" }, "547": { "code": "VN-70", "name": "V\u0129nh Ph\u00fac" }, "548": { "code": "VN-06", "name": "Y\u00ean B\u00e1i" }, "499": { "code": "VN-60", "name": "\u0110\u00e0 N\u1eb5ng" }, "500": { "code": "VN-33", "name": "\u0110\u1eafk L\u1eafk" }, "501": { "code": "VN-72", "name": "\u0110\u1eafk N\u00f4ng" }, "502": { "code": "VN-71", "name": "\u0110i\u1ec7n Bi\u00ean" }, "503": { "code": "VN-39", "name": "\u0110\u1ed3ng Nai" }, "504": { "code": "VN-45", "name": "\u0110\u1ed3ng Th\u00e1p" } } }</script>
    <script type="text/javascript">
        var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
    </script>
<!--
<script type="text/javascript">
    document.observe('dom:loaded', function () {
        var shipping_address_select = $('shipping-address-select');
        var billing_address_select = $('billing-address-select');
        var billing_region_id = $('billing:region_id');
        var shipping_region_id = $('shipping:region_id');
        $('billing:country_id').observe('change', function () { AjaxupdateShippingandPayment() });
        $('shipping:country_id').observe('change', function () { AjaxupdateShippingandPayment() });

        if (billing_region_id != null) {
            $('billing:region_id').observe('change', function () { AjaxupdateShippingandPayment() });
            $('billing:region').observe('change', function () { AjaxupdateShippingandPayment() });
        }

        if (shipping_region_id != null) {
            $('shipping:region_id').observe('change', function () { AjaxupdateShippingandPayment() });
            $('shipping:region').observe('change', function () { AjaxupdateShippingandPayment() });
        }
        $('billing:postcode').observe('change', function () { AjaxupdateShippingandPayment() });

        $('shipping:postcode').observe('change', function () { AjaxupdateShippingandPayment() });
        $('billing:city').observe('change', function () { AjaxupdateShippingandPayment() });

        $('shipping:city').observe('change', function () { AjaxupdateShippingandPayment() });
        function AjaxupdateShippingandPayment() {
            var shipment_methods = $('ajax-shipping-method');
            var payment_methods = $('ajax-payment-methods');
            var totals = $('checkout-review-load');
            var shipment_methods_found = false;
            var defaultvalut = 0;

            if (typeof shipment_methods != 'undefined' && shipment_methods != null) {

                shipment_methods_found = true;
            }

            if (shipment_methods_found) {
                shipping.reloadReviewBlock();
                shipment_methods.update('<div class="loading-ajax">&nbsp;</div>');
            }

            payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
            totals.update('<div class="loading-ajax">&nbsp;</div>');
            this.saveUrl = 'CheckOut.aspx/'
            var request = new Ajax.Request(
                this.saveUrl,
                {
                    method: 'post',
                    parameters: Form.serialize('co-form'),
                    onSuccess: function (transport) {

                        if (transport.status == 200) {

                            var data = transport.responseText.evalJSON();
                            if (shipment_methods_found) {
                                shipping.reloadReviewBlock();
                                shipment_methods.update(data.shipping_method);
                            }

                            payment_methods.update(data.payment_method);
                            if (defaultvalut == 0) {
                                payment.switchMethod(paymentMethod);
                                defaultvalut = 1;
                            }
                            checkout.reloadReviewBlock();
                            // totals.update(data.product_information);
                        }
                    }
                }
            );
        }
    })

</script>
    -->
<script type="text/javascript">
    function loadDistrict(provinceObj, districtId) {
        if (jQuery(provinceObj).val() == '') {
            jQuery('#' + districtId).empty();
            return;
        }

        jQuery('#' + districtId).attr("disabled", true);

        jQuery.ajax({
            type: 'post',
            url: 'http://shopping.pnj.com.vn/district/index/index/',
            data: 'province=' + jQuery(provinceObj).val(),
            success: function (option) {
                jQuery('#' + districtId).empty().append(option);
                jQuery('#' + districtId).attr("disabled", false);
            }
        });
    }
</script>                                <div style="display:none">
<div id="box-invoice" style="padding: 20px;">
    <table align="center">
        <tr>
            <td>&nbsp;</td>
            <td style="padding-left: 35px; padding-bottom: 20px;"><h2>Vui lòng nhập thông tin xuất hóa đơn</h2></td>
        </tr>
        <tr>
            <td valign="top" style="width: 110px;"><label for="company_address_temp"><b>Tên công ty <em>*</em></b></label></td>
            <td><input style="width: 350px;" id="company_name_temp" type="text" name="company_name_temp" value=""></td>
        </tr>
        <tr>
            <td valign="top"><label for="company_address_temp"><b>Địa chỉ công ty <em>*</em></b></label></td>
            <td><input style="width: 350px;" id="company_address_temp" type="text" name="company_address_temp" value=""></td>
        </tr>
        <tr>
            <td valign="top"><label for="company_taxvat_temp"><b>Mã số thuế <em>*</em></b></label></td>
            <td><input style="width: 350px;" id="company_taxvat_temp" type="text" name="company_vat_temp" value=""></td>
        </tr>
        <tr>
            <td valign="top" colspan="2" align="center">
                <button onclick="vatComfirm();" style="border: 1px solid #D4D4D4; border-radius: 3px; height: 30px; margin: 0 2px;" class="button" type="button" id="vat_confirm">&nbsp;&nbsp;ĐỒNG Ý&nbsp;&nbsp;</button>
            </td>
        </tr>
    </table> 
    
    <script type="text/javascript">

        function vatComfirm() {
            var flag = true;

            if (!jQuery('#company_name_temp').val() || /^\s*$/.test(jQuery('#company_name_temp').val())) { // Check cname not empty
                jQuery('#company_name_temp').css('border', '1px solid #B94A48');
                flag = false;
            } else {
                jQuery('#company_name_temp').css('border', '1px solid #CCCCCC');
            }

            if (!jQuery('#company_address_temp').val() || /^\s*$/.test(jQuery('#company_address_temp').val())) { // Check cname not empty
                jQuery('#company_address_temp').css('border', '1px solid #B94A48');
                flag = false;
            } else {
                jQuery('#company_address_temp').css('border', '1px solid #B94A48');
            }

            if (!jQuery('#company_taxvat_temp').val() || /^\s*$/.test(jQuery('#company_taxvat_temp').val())) { // Check cname not empty
                jQuery('#company_taxvat_temp').css('border', '1px solid #B94A48');
                flag = false;
            } else {
                jQuery('#company_vat_temp').css('border', '1px solid #B94A48');
            }

            if (flag == true) {
                jQuery('#company_name').val(jQuery('#company_name_temp').val());
                jQuery('#company_address').val(jQuery('#company_address_temp').val());
                jQuery('#company_taxvat').val(jQuery('#company_taxvat_temp').val());

                gFlag = 1;
                jQuery.fancybox.close();
            }
        }
    </script>
</div>
</div>                            </li>
                                                            <li id="onepage-shipping">
                                    <ul class="form-list">
    <!--<li class="control" id="shipping:same_as_billing_hide">
        <asp:CheckBox ID="cbNguoiDung" runat="server" style="margin: 0;" type="checkbox" name="billing[use_for_shipping]" OnCheckedChanged="cbNguoiDung_CheckedChanged" />
        <label style="display: inline; font-size: 12px;" for="shipping:same_as_billing">Người nhận hàng giống thông tin người đặt hàng</label>
    </li>
    
        <!-- start of Default Shipping Address -->
            <!-- End of Default Shipping Address -->
    
    <!-- start of shipping fields -->   
    <li id="shipping-new-address-form">
                <!--<fieldset>
                    <input type="hidden" name="shipping[address_id]" value="" id="shipping:address_id" />
                    <input type="hidden" name="hasaddress" value="0" id="shipping:has_addresss" />
                    <ul>
                        <li class="fields">
                            <div class="customer-name">
                                
    <div class="field name-firstname">
        <label for="shipping:firstname" class="required">Họ tên<em>*</em></label>
        <input type="text" id="shipping:firstname" name="shipping[firstname]" value="" title="Họ tên" maxlength="255" class="input-text required-entry" onchange="shipping.setSameAsBilling(false)" required="required"  />
    </div>
</div>
                        </li>
                        
                                                <li class="fields" >
                            <div class="field">
                                <label for="shipping:telephone" class="required">Di động<em>*</em></label>
                                <div class="input-box">
                                    <input maxlength="15" type="text" name="shipping[telephone]" value="" title="Điện thoại" class="input-text required-entry validate-number" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
                                </div>
                            </div>
                        </li>
                                                
                                       
                    <li class="input-box">
                        <label for="shipping:street1" class="required">Địa chỉ<em>*</em></label>
                        <input type="text" title="Đường phố" name="shipping[street][]" id="shipping:street1" value="" class="input-text required-entry" onchange="shipping.setSameAsBilling(false);"/>
                    </li>
                                
                                <li class="fields">
                    <div class="field">
                        <label for="shipping:region" class="required">Tỉnh/Thành phố<em>*</em></label>
                        <div class="input-box">
                            <select onchange="loadDistrict(this, 'shipping_city');" style="width: 295px;" id="shipping:region_id" name="shipping[region_id]" title="Tỉnh/Thành phố" class="validate-select" style="display:none;">
                                <option value="">Vui lòng chọn</option>
                            </select>
                            
                            <script type="text/javascript">
                                //<![CDATA[
                                $('shipping:region_id').setAttribute('defaultValue', "");
                                //]]>
                            </script>
                            <input type="text" id="shipping:region" name="shipping[region]" value="" title="Tỉnh/Thành phố" class="input-text" style="display:none;" />
                        </div>
                    </div>
                </li>
                        
                        <li class="fields shipping-city-field" >
                <label for="shipping_city" class="required">Quận/Huyện<em>*</em></label>
                <select style="width: 295px;" id="shipping_city" name="shipping[city]" title="Quận/Huyện" class="validate-select">
                    <option value="">Vui lòng chọn</option>
                </select>
            </li>
            
                                                                <li class="fields">
                                <input type="hidden" name="shipping[country_id]" id="shipping:country_id" value="VN" />
                                    </li>CheckOut.aspx

                
                                                        <li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
                                                    </ul>
                                                </fieldset>-->
                                            </li>                                             
                                            <!-- End of shipping fields -->
                                        </ul>

<script type="text/javascript">
    //<![CDATA[
    var shipping = new Shipping('co-form', '.aspx', '.aspx', '.aspx');
    var shippingForm = new VarienForm('co-form');
    shipping.setSameAsBilling(true);
    shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
    $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
    var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
    //]]>
</script>
                                </li>
                                
                            <li id="onepage-vat" class="control">
                                <input type="checkbox" id="checkinvoice" class="checkbox" name="checkinvoice" style="margin: 0;">
                                <label for="checkinvoice" style="display: inline; font-size: 12px;">Xuất hóa đơn công ty</label>
                                <a href="#box-invoice" id="a_checkinvoice" style="color: #787878; text-decoration: none;">&nbsp;</a>
                            </li>
                        </ul>
                    </li>

                    <li id="column-2" class="firecheckout-section">
                        <ul>
                                                            <li id="onepage-shipping_method">
                                    <!---Title  of the page -->
<div class="page-title">
  <span class="shipping-method-bg"></span>  <h2>Giao nhận</h2>
  <div class="clear"></div>
</div>
<!---End of Title -->
<div id="ajax-shipping-method">

  
<div>
            <strong>Giá vận chuyển: </strong>
                    <input style="display: none;" checked="checked" name="shipping_method" type="radio" class="validate-one-required-by-name" value="freeshipping_freeshipping" id="s_method_freeshipping_freeshipping" />
            <label for="s_method_freeshipping_freeshipping" style="display: inline;">
                <strong>
                                                
                                <span style="color: #E40000;">Miễn phí nội thành TP Hồ Chí Minh</span>
                
                                </strong>
            </label>
            </div>
<p style="margin-top: 5px;">( Giao nội thành trong vòng 2 ngày. Tỉnh thành khác từ 2 - 4 ngày )</p>

</div>                                </li>
                                                            <li id="onepage-payment">
                                <script type="text/javascript">
                                    //<![CDATA[
                                    var payment = new Payment('CheckOut.aspx', 'CheckOut.aspx', 'CheckOut.aspx');
                                    //]]>
 </script>
 
<div class="page-title">
  <span class="payment-bg"></span>  <h2>Thanh toán</h2>
  <div class="clear"></div>
</div>

<div id="ajax-payment-methods">

<dl class="sp-methods" id="checkout-payment-method-load">
    <dt>
            <input id="p_method_direct" value="direct" type="radio" name="payment[method]" title="Khi nhận hàng (COD - chỉ áp dụng TP.HCM)" onclick="payment.switchMethod('direct')" checked="checked"   class="radio validate-one-required-by-name" />
            <label for="p_method_direct">Thanh toán qua PayPal </label>
    </dt>
        <dt>
            <!--<input id="p_method_banktransfer" value="banktransfer" type="radio" name="payment[method]" title="Chuyển khoản Ngân Hàng" onclick="payment.switchMethod('banktransfer')"  class="radio validate-one-required-by-name" />
            <label for="p_method_banktransfer">Chuyển khoản Ngân Hàng </label>-->
    </dt>
        <dd id="container_payment_method_banktransfer" class="payment-method">
            <ul class="form-list checkout-agreements" id="payment_form_banktransfer" style="display:none;">
        <li>
            <div class="banktransfer-instructions-content agreement-content">
            </div>
        </li>
    </ul>
    </dd>
    </dl>

<script type="text/javascript">
    

    //var checkout = new Checkout();
    $$('#checkout-payment-method-load dt input').invoke('observe', 'click', function (e) {

        var element = e.element();
        var name = 'payment_form_' + element.getValue();
        payment.currentMethod = element.getValue();
        /* Hide all other forms */
        $$('dd.payment-method').invoke('hide');

        if (element.checked) {
            var form = $(name);
            var container = $('container_payment_method_' + element.getValue());

            if (element !== null && container !== null) {
                container.show();
                $(name).show();
            }
        }
    });

    /// cvv number
    function toggleToolTip(event) {
        if ($('payment-tool-tip')) {
            $('payment-tool-tip').setStyle({
                top: (Event.pointerY(event) - 560) + 'px'//,
                //left: (Event.pointerX(event)+100)+'px'
            })
            $('payment-tool-tip').toggle();
        }
        Event.stop(event);
    }
    if ($('payment-tool-tip-close')) {
        Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
    }

    $$('.cvv-what-is-this').each(function (element) {
        element.href = "javascript:void(0);";
        element.observe('click', respond);
        function respond() {
            document.getElementById('payment-tool-tip').style.display = "block";
            document.getElementById('payment-tool-tip').style.top = "450px";
        }
    })


</script></div>

<div class="tool-tip" id="payment-tool-tip" style="display:none;">
    <div class="btn-close"><a href="#" id="payment-tool-tip-close" title="Đóng">Đóng</a></div>
    <div class="tool-tip-content"><img src="http://shopping.pnj.com.vn/skin/frontend/base/default/images/cvv.gif" alt="Card Verification Number Visual Reference" title="Card Verification Number Visual Reference" /></div>
</div>

                            </li>
                        </ul>
                    </li>

                    <li id="column-3" class="firecheckout-section">
                        <ul>
                            <li id="onepage-review">
                                <div class="page-title">
  <span class="review-bg"></span>  <h2>Thông tin đơn hàng</h2>
  <div class="clear"></div>
</div>
<div class="order-review" id="checkout-review-load">
    <table id="checkout-review-table" class="onestepcheckout-summary">
        <colgroup>
        <col>
        <col width="1">
        <col width="1">
        <col width="1">
        </colgroup>
        <tr class="first last">
            <th class="name" style="width:200px;" rowspan="1">Tên sản phẩm</th>
            <th class="" style="font-weight:bold;" colspan="1">Giá</th>
            <th class="qty" rowspan="1">Số lượng</th>
            <th class="total" colspan="1">Thành tiền</th>
        </tr>
        <asp:Repeater ID="rpSoLuongSP" runat="server">
            <ItemTemplate>
                <tr class="first last odd">
                    <td><%#Eval("TenSP")%> </td>
                    <td class="a-right">
                        <span class="cart-price">
                            <span class="price"><%#Eval("Gia", "{0:0,00} VNĐ")%></span>
                        </span>
                   </td>
                   <td class="a-center"><%#Eval("SoLuong")%></td>
                   <td class="a-right last">
                        <span class="cart-price">
                            <span class="price"><%#Eval("Gia", "{0:0,00} VNĐ")%></span>
                        </span>
                   </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        
        <tr>
            <td class="a-left" colspan="3" style=""> Phí vận chuyển: </td>
            <td class="a-right last" style="">
                <span class="price"><asp:Label ID="lbPhiVanChuyen" runat="server" Text=""></asp:Label> VNĐ</span>
            </td>
        </tr>
        <tr class="last">
            <td class="a-left" colspan="3" style="">
                <strong>Tổng cộng:</strong>
            </td>
            <td class="a-right last" style="">
                <strong>
                    <span class="price">
                        <asp:Label ID="lbTongTien" runat="server" Text=""></asp:Label> VND</span>
                </strong>
            </td>
        </tr>
    </table>
</div>     
<div id="checkout-review-submit">
    <span>Vui lòng điền chính xác các thông tin để tránh sai sót trong quá trình vận chuyển.</span>
    <div class="button-set" id="review-buttons-container">
        <asp:TextBox ID="txtTongTien" class="username input" type='hidden' runat="server"></asp:TextBox>
        <input class="username input" name="amount" type="hidden" value="">
	    <input type='hidden' name='business' value='itmevn103-facilitator@gmail.com'>
	    <input type='hidden' name='cmd' value='_xclick'>
	    <input type='hidden' name='item_name' value='PayMent'>
	    <input type='hidden' name='item_number' value='123'>
	    <input type='hidden' name='no_shipping' value='1'>
	    <input type='hidden' name='currency_code' value='USD'>
	    <input type='hidden' name='cancel_return' value='PaySucess.aspx'>
	    <input type='hidden' name='return' value='PayFail.aspx'>
        <asp:Button ID="review" runat="server" class="button btn-checkout" Text="Đặt Hàng" OnClick="review_Click" />
   <div class="wait" id="review-please"  >
        </div>
    </div>
</div>
                                
<!---End of order information   
<script type="text/javascript">
    //<![CDATA[
    //var review;
    //shipping.reloadReviewBlock();
    var review = new Review('co-form', '#', '#', $('checkout-agreements'));
    //]]>
    </script>
<div id="product-details"></div>

<script type="text/javascript">
    var test1;
    function lightboxAction(Id) {
        test1 = new Lightbox_apptha(Id);
        test1.open();
    }

    function closeLink() {
        test1.close();
    }
</script>                            </li>
                        </ul>
                    </li>
                </ol>
            </form>
            End of onestepcheckout-form

            <div class="authentication" id="checkout-paypaliframe-load" style="display:none;"> </div>

            <script type="text/javascript">
                var shipment_methods = $('ajax-shipping-method');
                var checkout = new Checkout({
                    review: '#',
                    saveMethod: '#',
                    failure: '#'
                }
                );

                if (typeof shipment_methods != 'undefined' && shipment_methods != null) {
                    shipping.reloadReviewBlock();
                }

                payment.reloadReviewBlock();

                // Check VAT
                gFlag = 0;
                jQuery("#a_checkinvoice").fancybox({
                    'overlayColor': '#003064',
                    'onClosed': function () {
                        if (gFlag == 0) // unckeck checkbox
                        {
                            jQuery('#company_name').val('');
                            jQuery('#company_address').val('');
                            jQuery('#company_taxvat').val('');

                            jQuery('#checkinvoice').attr('checked', false); // Unchecks it
                        }
                        gFlag = 0;
                    }
                });

                jQuery('#checkinvoice').click(function () {
                    if (jQuery(this).is(':checked')) {
                        jQuery('#a_checkinvoice').click();
                        //jQuery('#companyli input').addClass('required-entry');
                        //jQuery('#vatli input').addClass('required-entry');
                    } else {
                        ///jQuery('#companyli input').removeClass('required-entry');
                        //jQuery('#companyli .validation-advice').remove();
                        //jQuery('#vatli input').removeClass('required-entry');
                        //jQuery('#vatli .validation-advice').remove();
                    }
                });
            </script>

            <script type="text/javascript">
                Translator.add('processing', 'Đang xử lý, vui lòng đợi.');
            </script>  
 -->
        </div>
                                    </div>
                    </div>
                                    </div>
                                </div>
			</div><!--end wrapper-->


        <div class="footer container_16">
            <div class="footer-links-items grid_4">
                <h3>Vì sao chọn PNJ</h3>
                <ul>
                        <li class="icon-1"><a href="#">Hướng dẫn mua hàng.</a></li>
                        <li class="icon-2"><a href="#">Hướng dẫn đo ni.</a></li>
                        <li class="icon-3"><a href="#">Phương thức thanh toán.</a></li>
                        <li class="icon-4"><a href="#">Phương thức vận chuyển.</a></li>
                        <li class="icon-2"><a href="#">Tư vấn sử dụng.</a></li>
                </ul>
            </div>
            <div class="footer-links-items grid_4">
                <h3>Chăm sóc khách hàng</h3>
                    <ul>
                        <li class="icon-2"><a href="#">Phương thức bảo hành.</a></li>
                        <li class="icon-6"><a href="#">Phương pháp bảo quản.</a></li>
                        <li class="icon-7"><a href="#">Phương thức thu đổi.</a></li>
                        <li class="icon-2"><a href="#">F.A.Q.</a></li>
                        <li class="icon-8"><a href="#">Chương trình Tích Lũy Điểm.</a></li>
                    </ul>
            </div>
            <div class="footer-links-items grid_4">
                    <h3>Về chúng tôi</h3>
                    <ul>
                        <li class="icon-9"><a href="#">Hệ thống cửa hàng.</a></li>
                        <li class="icon-10"><a href="#">Tin tức.</a></li>
                        <li class="icon-11"><a href="#">Tin khuyến mãi.</a></li>
                        <li class="icon-12"><a href="#">Liên hệ.</a></li>
                    </ul>
            </div>
            <div class="footer-links-items grid_4">
                    <h3>Đóng góp ý kiến </h3>
                    <ul>
                        <li class="icon-13"><a href="http://www.facebook.com/hoangvukenshin" target="new">Facebook</a></li>
                        <li class="icon-14"><a href="" target="new">Twiter</a></li>
                        <li class="icon-15"><a href="ymsgr:sendim?">Yahoo</a></li>
                    </ul>
            </div>
            <div class="footer-copyright grid_16">
                    <div class="clear"></div>
                    <p><a href="#">EC21</a> | <a href="#">CAO Fine Jewellery</a> | <a href="#">Phụ KiệnThời Trang JEMMA</a> | <a href="#">Vàng Miếng</a> | <a href="#">Kiểm Định Kim Cương</a> | <a href="#">Shopping Dymond Online</a></p>
                    <p>&copy; 2014 EC21 - All Rights Reserved</p>
            </div>
        </div>
    </div>
</div><!--end bg-->
</form>
</body>
</html>
